package com.loongtech.bi.entity.core;

import java.io.Serializable;
/**
 * 主键类，包括组合主键channelId和设备标识
 * @author xckuang
 * @date 2014-12-21
 */ 
public class KeyChannelAndDeviceId implements Serializable
{
	//平台标识
	private String				channelId;
	//设备标识
	private String				deviceId;
	private static final long	serialVersionUID	= 1L;

	public KeyChannelAndDeviceId()
	{
	}

	public KeyChannelAndDeviceId(String channelId, String deviceId)
	{
		this.channelId = channelId;
		this.deviceId = deviceId;
	}

	public String getChannelId()
	{
		return channelId;
	}

	public void setChannelId(String channelId)
	{
		this.channelId = channelId;
	}

	public String getDeviceId()
	{
		return deviceId;
	}

	public void setDeviceId(String deviceId)
	{
		this.deviceId = deviceId;
	}

	@Override
	public int hashCode()
	{
		final int prime = 31;
		int result = 1;
		result = prime * result + ((deviceId == null) ? 0 : deviceId.hashCode());
		result = prime * result + ((channelId == null) ? 0 : channelId.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj)
	{
		if (this == obj)
		{
			return true;
		}
		if (obj == null || getClass() != obj.getClass())
		{
			return false;
		}
		final KeyChannelAndDeviceId o = (KeyChannelAndDeviceId) obj;
		if (deviceId == null && o.deviceId != null || null != deviceId && !deviceId.equals(o.deviceId))
		{
			return false;
		}
		if (channelId == null && o.channelId != null || null != channelId && !channelId.equals(o.channelId))
		{
			return false;
		}
		return true;
	}

	@Override
	public String toString()
	{
		return "KeyChannelAndDeviceId [channelId=" + channelId + ", deviceId=" + deviceId + "]";
	}
}
